Following is the shell script for CF-A:

#!/bin/sh

defaults write com.apple.finder AppleShowAllFiles TRUE&&
osascript -e 'tell application "Finder" to quit'
osascript -e 'launch application "Finder"' &




Following is the shell script for CF-R

#!/bin/sh

defaults write com.apple.finder AppleShowAllFiles FALSE&&
osascript -e 'tell application "Finder" to quit'
osascript -e 'launch application "Finder"' &